class Piece extends Object
	abstract;

var vector INIT_POS;
var int currentState;
var vector position;
var int index;     
                
function int getIndex() {
	return currentState;
}  

function init(){
	currentState = 0;
	INIT_POS.X = 0;
	INIT_POS.Y = 0;
	INIT_POS.Z = 32;
	position = INIT_POS;
}

DefaultProperties
{
	
}

function changeState(){
	changeStateBy(1);
}

function restoreState(){
	changeStateBy(-1);
}

function changeStateBy(int i){
	local int nextState;
	nextState = getIndex() + i % 4;
	if(nextState < 0)
		nextState = 3;
	currentState = nextState;
}

function TwoDArray getCurrentBlockArray();

function vector getPosition(){
	return position;
}

/*function setPosition(vector v){
	position = v;
}*/

function setPosition(int x, int y){
	position.X = x;
	position.Y = y;
}
